package com.mall.demo.controller;

import com.mall.demo.entity.Plb;
import com.mall.demo.mapper.PlbMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/Pl")
public class PlbController {


    @Autowired
    private PlbMapper plbMapper;

    @GetMapping()
    @CrossOrigin
    public List<Plb> getAll(){
        List<Plb> plbs = plbMapper.selectList(null);
        return plbs;
    }

    @PostMapping("/insertOne")
    @CrossOrigin
    public void isnert(@RequestBody Plb plb){
        int insert = plbMapper.insert(plb);
        System.out.println(insert);
    }

}
